package com.uniview.entity.po;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * 用户角色表
 * @author Qingtian Lei
 *
 */
@Entity
@Table(name="sd_user_role")
public class UserRole implements Serializable {

	private static final long serialVersionUID = 1L;
	
	public int urId;  //编号
	
	public String userId;  //用户id
	
	public int roleId;  //角色id
	
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date createDate;  //创建时间
	
	public String userName;  //角色名称
	
	public String avator;  //用户头像
	
	public String deptName; //部门
	
	public String phone; //电话

	public UserRole(){};
	
	public UserRole(Employees emp, int roleId) {
		this.userId = emp.getEmpCode() + "";
		this.roleId = roleId;
		this.createDate = new Date();
		this.userName = emp.getEmpName();
		this.deptName = emp.getOrgName();
		this.phone = emp.getPhone();
	}
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getUrId() {
		return urId;
	}

	public void setUrId(int urId) {
		this.urId = urId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public int getRoleId() {
		return roleId;
	}

	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getAvator() {
		return avator;
	}

	public void setAvator(String avator) {
		this.avator = avator;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
}
